package seu.evaluation.metric;

import java.text.DecimalFormat;


/**
 * 
 * @author samantha
 * 度量全局的圈复杂度
 *
 */

public class ComplexityCCN extends MaintainabilityMetricStrategy{

	
	public ComplexityCCN(){
	}

	@Override
	protected String getType() {
		return "ComplexityCCN";
	}

	@Override
	protected double differentMetricMethod(MaintainabilityEntity entity) {
		return 0;
	}

	/**
	 * 覆盖父类方法
	 */
	@Override	
	protected void metric(){
		DecimalFormat f = new DecimalFormat("#0.00");
		int value = umlDiagramInfo.getTotalE()-umlDiagramInfo.getN()+2*umlDiagramInfo.getL();
		result.setFinalResult( f.format(value));
	}

	@Override
	protected void preprocess() {}
	
}
